//*********************************************************
//
//    Copyright (c) Microsoft. All rights reserved.
//    This code is licensed under the Apache License, Version 2.0.
//    THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
//    ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
//    IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
//    PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
//
//*********************************************************

namespace Microsoft.Research.eResearch.RuntimeServices.Logging
{
    using System;
    using System.Globalization;

    public abstract class LoggingServiceBase : ILoggingService
    {
        public abstract void Log(string level, string message);

        public virtual void Log(string level, string format, params object[] args)
        {
            Log(level, String.Format(CultureInfo.CurrentUICulture, format, args));
        }

        public virtual void Trace(string format, params object[] args)
        {
            Log("Trace", String.Format(CultureInfo.CurrentUICulture, format, args));
        }

        public virtual void Debug(string format, params object[] args)
        {
            Log("Debug", String.Format(CultureInfo.CurrentUICulture, format, args));
        }

        public virtual void Info(string format, params object[] args)
        {
            Log("Info", String.Format(CultureInfo.CurrentUICulture, format, args));
        }

        public virtual void Warn(string format, params object[] args)
        {
            Log("Warn", String.Format(CultureInfo.CurrentUICulture, format, args));
        }

        public virtual void Error(string format, params object[] args)
        {
            Log("Error", String.Format(CultureInfo.CurrentUICulture, format, args));
        }

        public virtual void Fatal(string format, params object[] args)
        {
            Log("Fatal", String.Format(CultureInfo.CurrentUICulture, format, args));
        }
    }
}
